package com.ruoyi.dealresources.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dealresources.mapper.AmDealHoursingResourcesMapper;
import com.ruoyi.dealresources.domain.AmDealHoursingResources;
import com.ruoyi.dealresources.service.IAmDealHoursingResourcesService;

/**
 * 成交房源和合同关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-29
 */
@Service
public class AmDealHoursingResourcesServiceImpl implements IAmDealHoursingResourcesService 
{
    @Autowired
    private AmDealHoursingResourcesMapper amDealHoursingResourcesMapper;

    /**
     * 查询成交房源和合同关联
     * 
     * @param id 成交房源和合同关联ID
     * @return 成交房源和合同关联
     */
    @Override
    public AmDealHoursingResources selectAmDealHoursingResourcesById(Long id)
    {
        return amDealHoursingResourcesMapper.selectAmDealHoursingResourcesById(id);
    }

    /**
     * 查询成交房源和合同关联列表
     * 
     * @param amDealHoursingResources 成交房源和合同关联
     * @return 成交房源和合同关联
     */
    @Override
    public List<AmDealHoursingResources> selectAmDealHoursingResourcesList(AmDealHoursingResources amDealHoursingResources)
    {
        return amDealHoursingResourcesMapper.selectAmDealHoursingResourcesList(amDealHoursingResources);
    }

    /**
     * 新增成交房源和合同关联
     * 
     * @param amDealHoursingResources 成交房源和合同关联
     * @return 结果
     */
    @Override
    public int insertAmDealHoursingResources(AmDealHoursingResources amDealHoursingResources)
    {
        amDealHoursingResources.setCreateTime(DateUtils.getNowDate());
        return amDealHoursingResourcesMapper.insertAmDealHoursingResources(amDealHoursingResources);
    }

    /**
     * 修改成交房源和合同关联
     * 
     * @param amDealHoursingResources 成交房源和合同关联
     * @return 结果
     */
    @Override
    public int updateAmDealHoursingResources(AmDealHoursingResources amDealHoursingResources)
    {
        return amDealHoursingResourcesMapper.updateAmDealHoursingResources(amDealHoursingResources);
    }

    /**
     * 批量删除成交房源和合同关联
     * 
     * @param ids 需要删除的成交房源和合同关联ID
     * @return 结果
     */
    @Override
    public int deleteAmDealHoursingResourcesByIds(Long[] ids)
    {
        return amDealHoursingResourcesMapper.deleteAmDealHoursingResourcesByIds(ids);
    }

    /**
     * 删除成交房源和合同关联信息
     * 
     * @param id 成交房源和合同关联ID
     * @return 结果
     */
    @Override
    public int deleteAmDealHoursingResourcesById(Long id)
    {
        return amDealHoursingResourcesMapper.deleteAmDealHoursingResourcesById(id);
    }
}
